cmake_minimum_required(VERSION 3.10)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_VERBOSE_MAKEFILE ON)

set(THREADS_PREFER_PTHREAD_FLAG ON)

find_package(Threads REQUIRED)

set(UTILS "./utils/dbutils.hpp" "./utils/kvutils.hpp" "./utils/logutils.hpp" "./utils/transutils.hpp" "./utils/timeutils.hpp")
set(API "./api/receipt.hpp" "./api/user.hpp" "./api/chart.hpp" "./api/distribution.hpp" "./api/donor.hpp" "./api/donee.hpp" "./api/warehouse.hpp")

add_executable(app_server "main.cpp" ${UTILS} ${API})

target_include_directories(app_server PRIVATE "./")

target_link_libraries(app_server PRIVATE Threads::Threads sqlite3 leveldb snappy)

target_compile_options(app_server PRIVATE -g)

install(TARGETS app_server DESTINATION bin)